<!DOCTYPE html>
<html>
<head th:replace="base/head_source :: head('登录')"></head>
<body>
	<nav th:replace="base/nav"></nav>
	<div class="container">
		<div class="row">
			<div class="col-md-8">
				<div class="alert alert-danger" th:unless="${error == null}"
					th:text="${messages.getMessage(error)}"></div>
				<form th:action="@{/login}" method="post" th:object="${loginBean}">
					<div class="form-group">
						<label for="username">用户名</label> <input type="text"
							class="form-control" th:field="*{username}" placeholder="用户名">
					</div>
					<div class="form-group">
						<label for="password">密码</label> <input type="password"
							class="form-control" th:field="*{password}" placeholder="密码">
					</div>
					<div class="checkbox">
						<label><input type="checkbox" th:field="*{rememberMe}" />记住我
						</label>
					</div>
					<div class="form-group">
						<label for="captcha">验证码</label>
						<div style="margin-bottom: 10px">
							<img th:src="@{/captcha}" class="img-responsive" id="validateImg" />
						</div>
						<input type="text" class="form-control" name="validateCode"
							placeholder="验证码">
					</div>
					<input type="hidden" th:name="${_csrf.parameterName}"
							th:value="${_csrf.token}" />
					<button type="submit" class="btn btn-default">登录</button>
				</form>
			</div>
		</div>
	</div>
	<div th:replace="base/foot"></div>
	<div th:replace="base/foot_source"></div>
	<script th:inline="javascript">
	/*<![CDATA[*/
	    $(document).ready(function(){
	    	$("#validateImg").click(function(){
	    		var src = /*[[@{/captcha}]]*/;
	    		$(this).attr("src",src+"?time="+new Date().getTime())
	    	});
	    });
	/*]]>*/
	</script>
</body>
</html>